#pragma once

//#include <stack>


class CAnyEditor;
class CAnyView;
class CMenuContext;
class CEditorData;

class GEOMDBAPI CEditorMgr
{
public:
	CEditorMgr(CAnyView* pAnyView);
	~CEditorMgr(void);
	void PushEditor(CAnyEditor* pEditor);
	CAnyEditor* PopEditor();
	CAnyEditor* GetTopEidtor(void);
	void SetDefaultEditor();
	//--------------------------------
	// Message for editor
	UINT OnLButtonDown(UINT nFlags, long x, long y);
	UINT OnLButtonUp(UINT nFlags, long x, long y);
	void OnMouseMove(UINT nFlags, long x, long y);
	UINT OnRButtonDown(UINT nFlags, long x, long y);
	UINT OnRButtonUp(UINT nFlags, long x, long y);
	UINT OnMouseWheel(UINT nFlags, short zDelta,long x, long y);
	// Key messages
	UINT OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	UINT OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	UINT OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	// Context menu
	void OnContextMenu(const CMenuContext& contextMenu);

	bool StartEditor(const CString& szEditorID, const CEditorData& edData);
private:
	CAnyView*		m_pAnyView;

	CAnyEditor*    m_pEditorCur;
	CAnyEditor*	m_pEditorBak;
	CAnyEditor*	m_pDefaultEditor;
};
